home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / demobook / DupIcons.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  32.9 KB  |  1,028 lines

  1. /*
  2.  * Copyright 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <Xm/Xm.h>
  20. #include <X11/StringDefs.h>
  21. #include <Xm/Form.h>
  22. #include <Xm/RowColumn.h>
  23. #include <Xm/SeparatoG.h>
  24. #include <Xm/PushB.h>
  25. #include <Xm/Label.h>
  26. #include "exbookglo.h"
  27. #include "exinterfmotif.h"
  28. #ifdef DEBUG
  29. #include <malloc.h>
  30. #endif
  31. /*
  32. #include "exglobals.h"
  33. */
  34.  
  35. extern char *(extract_first_xms_segment() );
  36. extern struct indexlist *(find_keyword_int() );
  37. extern struct indexlist *(find_keyword() );
  38. extern struct indexlist *(add_keyword() );
  39. extern struct icntmpltstruct **duplicate_icons;
  40. extern int find_blank(char *s);
  41. extern int dup_icn_cnt;
  42. int dup_number;
  43. static   struct iconstruct *lasticonptr;
  44.  
  45.    Widget DupIcons_shell;
  46.    Widget AskDupIcons_shell;
  47.    Widget AskDupLabel;
  48.    Widget ONameLabel, OCommandLabel, OKeywordLabel, OFilesLabel, OGroupsLabel;
  49.    Widget OAltCommandLabel, OHelpFileLabel;
  50.    Widget DNameLabel, DCommandLabel, DKeywordLabel, DFilesLabel, DGroupsLabel;
  51.    Widget DAltCommandLabel, DHelpFileLabel;
  52.  
  53. void popup_AskDupIcons(int dup_icn_cnt);
  54. void resolveCB_AskDupIcons(Widget w,XtPointer client_data, XtPointer call_data);
  55. void ignoreCB_AskDupIcons(Widget w, XtPointer client_data, XtPointer call_data);
  56. void noCB_DupIcons(Widget w, XtPointer client_data, XtPointer call_data);
  57. void yesCB_DupIcons(Widget w, XtPointer client_data, XtPointer call_data);
  58.  
  59. Widget create_DupIcons()
  60. {
  61.    Widget topform;
  62.    Widget label, rc1, rc2, y_button, n_button;
  63.    Widget rc3;
  64.    Widget bottom_form, form, sep;
  65.    Arg wargs[15];
  66.    int n;
  67.    XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
  68.  
  69.    DupIcons_shell = XtVaCreatePopupShell( "DupIconsshell",
  70.         topLevelShellWidgetClass, DBtoplevel,
  71.         XmNtitle, "Duplicate Icons",
  72.         XmNallowShellResize, TRUE, NULL);
  73.  
  74.    n = 0;
  75.    XtSetArg (wargs[n], XmNverticalSpacing, 10); n++;
  76.    XtSetArg (wargs[n], XmNhorizontalSpacing, 10); n++;
  77.    topform = XtCreateManagedWidget("AskDupIconsTopForm", xmFormWidgetClass,
  78.     DupIcons_shell, wargs, n);
  79.  
  80.    n = 0;
  81.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  82.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  83.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  84.    bottom_form = XtCreateManagedWidget( "DupIBottomForm", xmFormWidgetClass,
  85.         topform, wargs, n);
  86.  
  87.    n = 0;
  88.    XtSetArg (wargs[n], XmNverticalSpacing, 10); n++;
  89.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  90.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  91.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  92.    sep = XtCreateManagedWidget("Sep", xmSeparatorGadgetClass,
  93.         bottom_form, wargs, n);
  94.  
  95.    n = 0;
  96.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  97.    XtSetArg (wargs[n], XmNtopWidget, sep); n++;
  98.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  99.    label = XtCreateManagedWidget("QuestionLabel", xmLabelWidgetClass,
  100.     bottom_form, wargs, n);
  101.  
  102.    n = 0;
  103.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  104.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  105.    XtSetArg (wargs[n], XmNtopWidget, sep); n++;
  106.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  107.    XtSetArg (wargs[n], XmNleftWidget, label); n++;
  108.    y_button = XtCreateManagedWidget( "YesButton", xmPushButtonWidgetClass,
  109.         bottom_form, wargs, n);
  110.    XtAddCallback( y_button, XmNactivateCallback, yesCB_DupIcons, NULL);
  111.  
  112.    n = 0;
  113.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  114.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  115.    XtSetArg (wargs[n], XmNtopWidget, sep); n++;
  116.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  117.    XtSetArg (wargs[n], XmNleftWidget, y_button); n++;
  118.    n_button = XtCreateManagedWidget( "NoButton", xmPushButtonWidgetClass,
  119.         bottom_form, wargs, n);
  120.    XtAddCallback( n_button, XmNactivateCallback, noCB_DupIcons, NULL);
  121.  
  122.    n = 0;
  123.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  124.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_WIDGET); n++;
  125.    XtSetArg (wargs[n], XmNbottomWidget, bottom_form); n++;
  126.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  127.    form = XtCreateManagedWidget( "DupIForm1", xmFormWidgetClass,
  128.         topform, wargs, n);
  129.  
  130.    n = 0;
  131.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  132.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  133.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  134.    label = XtCreateManagedWidget("OriginalLabel", xmLabelWidgetClass,
  135.     form, wargs, n);
  136.  
  137.    n = 0;
  138.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  139.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  140.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  141.    XtSetArg (wargs[n], XmNtopWidget, label); n++;
  142.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  143.    rc1 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass, 
  144.     form, wargs, n);
  145.  
  146.    n = 0;
  147.    label = XtCreateManagedWidget("NameLabel", xmLabelWidgetClass,
  148.     rc1, wargs, n);
  149.  
  150.    n = 0;
  151.    ONameLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  152.     rc1, wargs, n);
  153.  
  154.    n = 0;
  155.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  156.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  157.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  158.    XtSetArg (wargs[n], XmNtopWidget, rc1); n++;
  159.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  160.    rc2 = XtCreateManagedWidget("RC2", xmRowColumnWidgetClass,
  161.     form, wargs, n);
  162.  
  163.    n = 0;
  164.    label = XtCreateManagedWidget("CommandLabel", xmLabelWidgetClass,
  165.     rc2, wargs, n);
  166.  
  167.    n = 0;
  168.    OCommandLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  169.     rc2, wargs, n);
  170.  
  171.    n = 0;
  172.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  173.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  174.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  175.    XtSetArg (wargs[n], XmNtopWidget, rc2); n++;
  176.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  177.    rc3 = XtCreateManagedWidget("RC3", xmRowColumnWidgetClass,
  178.     form, wargs, n);
  179.  
  180.    n = 0;
  181.    label = XtCreateManagedWidget("AltCommandLabel", xmLabelWidgetClass,
  182.     rc3, wargs, n);
  183.  
  184.    n = 0;
  185.    OAltCommandLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  186.     rc3, wargs, n);
  187.  
  188.    n = 0;
  189.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  190.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  191.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  192.    XtSetArg (wargs[n], XmNtopWidget, rc3); n++;
  193.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  194.    rc2 = XtCreateManagedWidget("RC2", xmRowColumnWidgetClass,
  195.     form, wargs, n);
  196.  
  197.    n = 0;
  198.    label = XtCreateManagedWidget("HelpFileLabel", xmLabelWidgetClass,
  199.     rc2, wargs, n);
  200.  
  201.    n = 0;
  202.    OHelpFileLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  203.     rc2, wargs, n);
  204.  
  205.    n = 0;
  206.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  207.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  208.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  209.    XtSetArg (wargs[n], XmNtopWidget, rc2); n++;
  210.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  211.    rc1 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass,
  212.     form, wargs, n);
  213.  
  214.    n = 0;
  215.    label = XtCreateManagedWidget("KeywordsLabel", xmLabelWidgetClass,
  216.     rc1, wargs, n);
  217.  
  218.    n = 0;
  219.    OKeywordLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  220.     rc1, wargs, n);
  221.  
  222.    n = 0;
  223.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  224.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  225.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  226.    XtSetArg (wargs[n], XmNtopWidget, rc1); n++;
  227.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  228.    rc2 = XtCreateManagedWidget("RC2", xmRowColumnWidgetClass,
  229.     form, wargs, n);
  230.  
  231.    n = 0;
  232.    label = XtCreateManagedWidget("FilesLabel", xmLabelWidgetClass,
  233.     rc2, wargs, n);
  234.  
  235.    n = 0;
  236.    OFilesLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  237.     rc2, wargs, n);
  238.  
  239.    n = 0;
  240.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  241.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  242.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  243.    XtSetArg (wargs[n], XmNtopWidget, rc2); n++;
  244.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  245.    rc1 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass,
  246.     form, wargs, n);
  247.  
  248.    n = 0;
  249.    label = XtCreateManagedWidget("GroupsLabel", xmLabelWidgetClass,
  250.     rc1, wargs, n);
  251.  
  252.    n = 0;
  253.    OGroupsLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  254.     rc1, wargs, n);
  255.  
  256.    n = 0;
  257.    XtSetArg (wargs[n], XmNverticalSpacing, 10); n++;
  258.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_WIDGET); n++;
  259.    XtSetArg (wargs[n], XmNbottomWidget, bottom_form); n++;
  260.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  261.    XtSetArg (wargs[n], XmNorientation, XmVERTICAL); n++;
  262.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  263.    XtSetArg (wargs[n], XmNleftWidget, form); n++;
  264.    sep = XtCreateManagedWidget("Sep", xmSeparatorGadgetClass,
  265.     topform, wargs, n);
  266.  
  267.    n = 0;
  268.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  269.    XtSetArg (wargs[n], XmNleftWidget, sep); n++;
  270.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_WIDGET); n++;
  271.    XtSetArg (wargs[n], XmNbottomWidget, bottom_form); n++;
  272.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  273.    form = XtCreateManagedWidget( "DupIForm2", xmFormWidgetClass,
  274.         topform, wargs, n);
  275.  
  276.    n = 0;
  277.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  278.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  279.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  280.    label = XtCreateManagedWidget("DuplicateLabel", xmLabelWidgetClass,
  281.     form, wargs, n);
  282.  
  283.    n = 0;
  284.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  285.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  286.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  287.    XtSetArg (wargs[n], XmNtopWidget, label); n++;
  288.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  289.    rc1 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass, 
  290.     form, wargs, n);
  291.  
  292.    n = 0;
  293.    label = XtCreateManagedWidget("NameLabel", xmLabelWidgetClass,
  294.     rc1, wargs, n);
  295.  
  296.    n = 0;
  297.    DNameLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  298.     rc1, wargs, n);
  299.  
  300.    n = 0;
  301.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  302.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  303.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  304.    XtSetArg (wargs[n], XmNtopWidget, rc1); n++;
  305.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  306.    rc2 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass,
  307.     form, wargs, n);
  308.  
  309.    n = 0;
  310.    label = XtCreateManagedWidget("CommandLabel", xmLabelWidgetClass,
  311.     rc2, wargs, n);
  312.  
  313.    n = 0;
  314.    DCommandLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  315.     rc2, wargs, n);
  316.  
  317.    n = 0;
  318.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  319.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  320.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  321.    XtSetArg (wargs[n], XmNtopWidget, rc2); n++;
  322.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  323.    rc3 = XtCreateManagedWidget("RC3", xmRowColumnWidgetClass,
  324.     form, wargs, n);
  325.  
  326.    n = 0;
  327.    label = XtCreateManagedWidget("AltCommandLabel", xmLabelWidgetClass,
  328.     rc3, wargs, n);
  329.  
  330.    n = 0;
  331.    DAltCommandLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  332.     rc3, wargs, n);
  333.  
  334.    n = 0;
  335.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  336.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  337.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  338.    XtSetArg (wargs[n], XmNtopWidget, rc3); n++;
  339.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  340.    rc2 = XtCreateManagedWidget("RC2", xmRowColumnWidgetClass,
  341.     form, wargs, n);
  342.  
  343.    n = 0;
  344.    label = XtCreateManagedWidget("HelpFileLabel", xmLabelWidgetClass,
  345.     rc2, wargs, n);
  346.  
  347.    n = 0;
  348.    DHelpFileLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  349.     rc2, wargs, n);
  350.  
  351.    n = 0;
  352.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  353.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  354.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  355.    XtSetArg (wargs[n], XmNtopWidget, rc2); n++;
  356.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  357.    rc1 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass,
  358.     form, wargs, n);
  359.  
  360.    n = 0;
  361.    label = XtCreateManagedWidget("KeywordsLabel", xmLabelWidgetClass,
  362.     rc1, wargs, n);
  363.  
  364.    n = 0;
  365.    DKeywordLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  366.     rc1, wargs, n);
  367.  
  368.    n = 0;
  369.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  370.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  371.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  372.    XtSetArg (wargs[n], XmNtopWidget, rc1); n++;
  373.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  374.    rc2 = XtCreateManagedWidget("RC2", xmRowColumnWidgetClass,
  375.     form, wargs, n);
  376.  
  377.    n = 0;
  378.    label = XtCreateManagedWidget("FilesLabel", xmLabelWidgetClass,
  379.     rc2, wargs, n);
  380.  
  381.    n = 0;
  382.    DFilesLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  383.     rc2, wargs, n);
  384.  
  385.    n = 0;
  386.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  387.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  388.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  389.    XtSetArg (wargs[n], XmNtopWidget, rc2); n++;
  390.    XtSetArg (wargs[n], XmNorientation, XmHORIZONTAL); n++;
  391.    rc1 = XtCreateManagedWidget("RC", xmRowColumnWidgetClass,
  392.     form, wargs, n);
  393.  
  394.    n = 0;
  395.    label = XtCreateManagedWidget("GroupsLabel", xmLabelWidgetClass,
  396.     rc1, wargs, n);
  397.  
  398.    n = 0;
  399.    DGroupsLabel = XtCreateManagedWidget("Label", xmLabelWidgetClass,
  400.     rc1, wargs, n);
  401.  
  402.    return(DupIcons_shell);
  403. }
  404.  
  405. void setup_dupicons()
  406. {
  407.    struct icntmpltstruct *dup_ptr, *orig_ptr;
  408.    XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
  409.    char *bigstring;
  410.    int len, biglen, maxlen;
  411.    struct wordlist *tmpkey;
  412.    struct grpliststruct *tmpgrps;
  413.    struct filelist *tmpfiles;
  414.    int i;
  415.   
  416.    maxlen = 32;
  417.    bigstring = (char *)malloc( maxlen * sizeof(char) );
  418.    biglen = 0;
  419.    bigstring[0] = '\0';
  420.    dup_ptr = duplicate_icons[dup_number];
  421.    orig_ptr = dup_ptr->nameptr->icon;
  422.  
  423.    XtVaSetValues( ONameLabel, XmNlabelString,
  424.     XmStringCreateLtoR(orig_ptr->nameptr->string, charset), NULL);
  425.    if (orig_ptr->startstring != NULL)
  426.       {
  427.       len = strlen(orig_ptr->startstring);
  428.       if (len > 50)
  429.          {
  430.          if (maxlen < len)
  431.             {
  432.             bigstring = (char *)realloc
  433.                  ( (void *)bigstring, (len + 5) * sizeof(char));
  434.             maxlen = len + 5;
  435.             }
  436.          strcpy(bigstring, orig_ptr->startstring);
  437.          i = find_blank(&(bigstring[30]));
  438.          bigstring[i+30] = '\n';
  439.          XtVaSetValues( OCommandLabel, XmNlabelString,
  440.        XmStringCreateLtoR(bigstring, charset), NULL);
  441.          }
  442.       else
  443.          XtVaSetValues( OCommandLabel, XmNlabelString,
  444.        XmStringCreateLtoR(orig_ptr->startstring, charset), NULL);
  445.          }
  446.    else /* orig icon has no start string */
  447.       {
  448.       sprintf(bigstring, "(none)");
  449.       XtVaSetValues( OCommandLabel, XmNlabelString,
  450.     XmStringCreateLtoR(bigstring, charset), NULL);
  451.       }
  452.    if (orig_ptr->alt_command == NULL)
  453.       {
  454.       sprintf(bigstring, "(none)");
  455.       XtVaSetValues( OAltCommandLabel, XmNlabelString,
  456.     XmStringCreateLtoR(bigstring, charset), NULL);
  457.       }
  458.    else
  459.       {
  460.       len = strlen(orig_ptr->alt_command);
  461.       if (len > 50)     /* do I need to add a break in the alt command */
  462.          {
  463.          if (len > maxlen)
  464.             {
  465.             bigstring = (char *)realloc
  466.                  ( (void *)bigstring, (len + 5) * sizeof(char));
  467.             maxlen = len + 5;
  468.             }
  469.          strcpy(bigstring, orig_ptr->alt_command);
  470.          i = find_blank(&(bigstring[30]));
  471.          bigstring[i+30] = '\n';
  472.          XtVaSetValues( OAltCommandLabel, XmNlabelString,
  473.        XmStringCreateLtoR(bigstring, charset), NULL);
  474.          }
  475.       else
  476.          XtVaSetValues( OAltCommandLabel, XmNlabelString,
  477.        XmStringCreateLtoR(orig_ptr->alt_command, charset), NULL);
  478.       }
  479.    if (orig_ptr->helpfile == NULL)
  480.       {
  481.       sprintf(bigstring, "(none)");
  482.       XtVaSetValues( OHelpFileLabel, XmNlabelString,
  483.     XmStringCreateLtoR(bigstring, charset), NULL);
  484.       }
  485.    else
  486.       {
  487.       XtVaSetValues( OHelpFileLabel, XmNlabelString,
  488.          XmStringCreateLtoR(orig_ptr->helpfile->name, charset), NULL);
  489.       }
  490.    
  491.    tmpkey = orig_ptr->keywords;
  492.    tmpgrps = orig_ptr->grps;
  493.    tmpfiles = orig_ptr->addtlfiles;
  494.    biglen = 0;
  495.    bigstring[0] = '\0';
  496.    if (tmpkey == NULL)  /* there are no keywords */
  497.       {
  498.       sprintf(bigstring, "(none)");
  499.       }
  500.    while (tmpkey != NULL)
  501.       {
  502.       if (biglen != 0)
  503.          strcat(bigstring, ", ");
  504.       biglen+=2;
  505.       len = strlen(tmpkey->indexptr->string);
  506.       if (len + 2 + biglen > maxlen)
  507.          {
  508.          maxlen += 32;
  509.          bigstring = (char *) realloc ( (void *) bigstring, maxlen);
  510.          }
  511.       strcat(bigstring, tmpkey->indexptr->string);
  512.       biglen = biglen + len;
  513.       tmpkey = tmpkey->next;
  514.       }
  515.    XtVaSetValues( OKeywordLabel, XmNlabelString,
  516.     XmStringCreateLtoR(bigstring, charset), NULL);
  517.    biglen = 0;
  518.    bigstring[0] = '\0';
  519.    if (tmpfiles == NULL)  /* there are no files */
  520.       {
  521.       sprintf(bigstring, "(none)");
  522.       }
  523.    while (tmpfiles != NULL)
  524.       {
  525.       if (biglen != 0)
  526.          strcat(bigstring, "\n");
  527.       biglen+=2;
  528.       len = strlen(tmpfiles->file->name);
  529.       if (len + 2 + biglen > maxlen)
  530.          {
  531.          maxlen += 32;
  532.          bigstring = (char *) realloc ( (void *) bigstring, maxlen);
  533.          }
  534.       strcat(bigstring, tmpfiles->file->name);
  535.       biglen = biglen + len;
  536.       tmpfiles = tmpfiles->next;
  537.       }
  538.    XtVaSetValues( OFilesLabel, XmNlabelString,
  539.     XmStringCreateLtoR(bigstring, charset), NULL);
  540.    biglen = 0;
  541.    bigstring[0] = '\0';
  542.    if (tmpgrps == NULL)  /* there are no groups */
  543.       {
  544.       sprintf(bigstring, "(none)");
  545.       }
  546.    while (tmpgrps != NULL)
  547.       {
  548.       if (biglen != 0)
  549.          strcat(bigstring, ", ");
  550.       biglen+=2;
  551.       len = strlen(tmpgrps->grpptr->nameptr->string);
  552.       if (len + 2 + biglen > maxlen)
  553.          {
  554.          maxlen += 32;
  555.          bigstring = (char *) realloc ( (void *) bigstring, maxlen);
  556.          }
  557.       strcat(bigstring, tmpgrps->grpptr->nameptr->string);
  558.       biglen = biglen + len;
  559.       tmpgrps = tmpgrps->next;
  560.       }
  561.    XtVaSetValues( OGroupsLabel, XmNlabelString,
  562.     XmStringCreateLtoR(bigstring, charset), NULL);
  563.  
  564.    XtVaSetValues( DNameLabel, XmNlabelString,
  565.     XmStringCreateLtoR(dup_ptr->nameptr->string, charset), NULL);
  566.    if (dup_ptr->startstring != NULL)
  567.       {
  568.       len = strlen(dup_ptr->startstring);
  569.       if (len > 50)
  570.          {
  571.          if (maxlen < len)
  572.             {
  573.             bigstring = (char *)realloc( (void *)bigstring, (len + 5) * sizeof(char));
  574.             maxlen = len + 5;
  575.             }
  576.          strcpy(bigstring, dup_ptr->startstring);
  577.          i = find_blank(&(bigstring[30]));
  578.          bigstring[i+30] = '\n';
  579.          XtVaSetValues( DCommandLabel, XmNlabelString,
  580.        XmStringCreateLtoR(bigstring, charset), NULL);
  581.          }
  582.       else 
  583.          XtVaSetValues( DCommandLabel, XmNlabelString,
  584.        XmStringCreateLtoR(dup_ptr->startstring, charset), NULL);
  585.       }
  586.    else  /* dup icon has no start string */
  587.       {
  588.       sprintf(bigstring, "(none)");
  589.       XtVaSetValues( DCommandLabel, XmNlabelString,
  590.     XmStringCreateLtoR(bigstring, charset), NULL);
  591.       }
  592.    if (dup_ptr->alt_command == NULL)
  593.       {
  594.       sprintf(bigstring, "(none)");
  595.       XtVaSetValues( DAltCommandLabel, XmNlabelString,
  596.     XmStringCreateLtoR(bigstring, charset), NULL);
  597.       }
  598.    else
  599.       {
  600.       len = strlen(dup_ptr->alt_command);
  601.       if (len > 50)     /* do I need to add a break in the alt command */
  602.          {
  603.          if (len > maxlen)
  604.             {
  605.             bigstring = (char *)realloc
  606.                  ( (void *)bigstring, (len + 5) * sizeof(char));
  607.             maxlen = len + 5;
  608.             }
  609.          strcpy(bigstring, dup_ptr->alt_command);
  610.          i = find_blank(&(bigstring[30]));
  611.          bigstring[i+30] = '\n';
  612.          XtVaSetValues( DAltCommandLabel, XmNlabelString,
  613.        XmStringCreateLtoR(bigstring, charset), NULL);
  614.          }
  615.       else
  616.          XtVaSetValues( DAltCommandLabel, XmNlabelString,
  617.        XmStringCreateLtoR(dup_ptr->alt_command, charset), NULL);
  618.       }
  619.    if (dup_ptr->helpfile == NULL)
  620.       {
  621.       sprintf(bigstring, "(none)");
  622.       XtVaSetValues( DHelpFileLabel, XmNlabelString,
  623.     XmStringCreateLtoR(bigstring, charset), NULL);
  624.       }
  625.    else
  626.       {
  627.       XtVaSetValues( DHelpFileLabel, XmNlabelString,
  628.          XmStringCreateLtoR(dup_ptr->helpfile->name, charset), NULL);
  629.       }
  630.    
  631.    tmpkey = dup_ptr->keywords;
  632.    tmpgrps = dup_ptr->grps;
  633.    tmpfiles = dup_ptr->addtlfiles;
  634.    biglen = 0;
  635.    bigstring[0] = '\0';
  636.    while (tmpkey != NULL)
  637.       {
  638.       if (biglen != 0)
  639.          strcat(bigstring, ", ");
  640.       biglen+=2;
  641.       len = strlen(tmpkey->indexptr->string);
  642.       if (len + 2 + biglen > maxlen)
  643.          {
  644.          maxlen += 32;
  645.          bigstring = (char *) realloc ( (void *) bigstring, maxlen);
  646.          }
  647.       strcat(bigstring, tmpkey->indexptr->string);
  648.       biglen = biglen + len;
  649.       tmpkey = tmpkey->next;
  650.       }
  651.    XtVaSetValues( DKeywordLabel, XmNlabelString,
  652.     XmStringCreateLtoR(bigstring, charset), NULL);
  653.    biglen = 0;
  654.    bigstring[0] = '\0';
  655.    while (tmpfiles != NULL)
  656.       {
  657.       if (biglen != 0)
  658.          strcat(bigstring, "\n");
  659.       biglen+=2;
  660.       len = strlen(tmpfiles->file->name);
  661.       if (len + 2 + biglen > maxlen)
  662.          {
  663.          maxlen += 32;
  664.          bigstring = (char *) realloc ( (void *) bigstring, maxlen);
  665.          }
  666.       strcat(bigstring, tmpfiles->file->name);
  667.       biglen = biglen + len;
  668.       tmpfiles = tmpfiles->next;
  669.       }
  670.    XtVaSetValues( DFilesLabel, XmNlabelString,
  671.     XmStringCreateLtoR(bigstring, charset), NULL);
  672.    biglen = 0;
  673.    bigstring[0] = '\0';
  674.    while (tmpgrps != NULL)
  675.       {
  676.       if (biglen != 0)
  677.          strcat(bigstring, ", ");
  678.       biglen+=2;
  679.       len = strlen(tmpgrps->grpptr->nameptr->string);
  680.       if (len + 2 + biglen > maxlen)
  681.          {
  682.          maxlen += 32;
  683.          bigstring = (char *) realloc ( (void *) bigstring, maxlen);
  684.          }
  685.       strcat(bigstring, tmpgrps->grpptr->nameptr->string);
  686.       biglen = biglen + len;
  687.       tmpgrps = tmpgrps->next;
  688.       }
  689.    XtVaSetValues( DGroupsLabel, XmNlabelString,
  690.     XmStringCreateLtoR(bigstring, charset), NULL);
  691.  
  692. }
  693.  
  694. Widget popup_DupIcons()
  695. {
  696.    dup_number = 0;
  697.    setup_dupicons();
  698.  
  699.    XtPopup(DupIcons_w, XtGrabNone);
  700. }
  701.  
  702. Widget create_AskDupIcons()
  703. {
  704.    Widget topform;
  705.    Widget r_button, i_button;
  706.    Arg wargs[15];
  707.    int n;
  708.  
  709.    AskDupIcons_shell = XtVaCreatePopupShell( "AskDupIconsshell",
  710.     topLevelShellWidgetClass, DBtoplevel,
  711.     XmNallowShellResize, TRUE, NULL);
  712.  
  713.    n = 0;
  714.    XtSetArg (wargs[n], XmNverticalSpacing, 10); n++;
  715.    XtSetArg (wargs[n], XmNhorizontalSpacing, 10); n++;
  716.    topform = XtCreateManagedWidget("AskDupIconsTopForm", xmFormWidgetClass, 
  717.     AskDupIcons_shell, wargs, n);
  718.  
  719.    n = 0;
  720.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_FORM); n++;
  721.    XtSetArg (wargs[n], XmNtopOffset, 15); n++;
  722.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  723.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  724.    XtSetArg (wargs[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
  725.    XtSetArg (wargs[n], XmNborderWidth, 0); n++;
  726.    AskDupLabel = XtCreateManagedWidget("LegendLabel", xmLabelWidgetClass,
  727.     topform, wargs, n);
  728.  
  729.    n = 0;
  730.    XtSetArg (wargs[n], XmNtopOffset, 10); n++;
  731.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  732.    XtSetArg (wargs[n], XmNtopWidget, AskDupLabel); n++;
  733.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  734.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_FORM); n++;
  735.    r_button = XtCreateManagedWidget( "ResolveButton", xmPushButtonWidgetClass,
  736.     topform, wargs, n);
  737.    XtAddCallback( r_button, XmNactivateCallback, resolveCB_AskDupIcons, NULL);
  738.  
  739.    n = 0;
  740.    XtSetArg (wargs[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
  741.    XtSetArg (wargs[n], XmNtopWidget, AskDupLabel); n++;
  742.    XtSetArg (wargs[n], XmNtopOffset, 10); n++;
  743.    XtSetArg (wargs[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  744.    XtSetArg (wargs[n], XmNrightAttachment, XmATTACH_FORM); n++;
  745.    XtSetArg (wargs[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  746.    XtSetArg (wargs[n], XmNleftWidget, r_button); n++;
  747.    i_button = XtCreateManagedWidget( "IgnoreButton", xmPushButtonWidgetClass,
  748.     topform, wargs, n);
  749.    XtAddCallback( i_button, XmNactivateCallback, ignoreCB_AskDupIcons, NULL);
  750.  
  751.    XtRealizeWidget(AskDupIcons_shell);
  752.    SetWMhints(AskDupIcons_shell);
  753.    return(AskDupIcons_shell);
  754. }
  755.  
  756. void ask_user_duplicate_icons(int dup_icn_cnt)
  757. {
  758.    if (dup_icn_cnt > 0)
  759.       {
  760.       popup_AskDupIcons(dup_icn_cnt);
  761.       }
  762. }
  763.  
  764. void popup_AskDupIcons(int dup_icn_cnt)
  765. {
  766.    char *bigstring;
  767.    XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
  768.  
  769.  
  770.    bigstring = malloc( 38 * 5 * sizeof (char) );
  771.    if (dup_icn_cnt == 1)
  772.       {
  773.       strcat(bigstring, "One demo in the appended file\n");
  774.       strcat(bigstring, "has the same name as a demo\n");
  775.       strcat(bigstring, "already in the database.  Do\n");
  776.       strcat(bigstring, "you want to resolve the conflict,\n");
  777.       strcat(bigstring, "or leave them as possible duplicates?");
  778.       }
  779.    else
  780.       {
  781.       sprintf(bigstring, "Some demos (%d) in the appended\n", dup_icn_cnt);
  782.       strcat(bigstring, "file have the same name as demos\n");
  783.       strcat(bigstring, "already in the database.  Do\n");
  784.       strcat(bigstring, "you want to resolve the conflicts,\n");
  785.       strcat(bigstring, "or leave them as possible duplicates?\n");
  786.       }
  787.    XtVaSetValues( AskDupLabel, XmNlabelString,
  788.     XmStringCreateLtoR(bigstring, charset), NULL);
  789.    XtPopup(AskDupIcons_w, XtGrabNone);
  790. }
  791.  
  792. void noCB_DupIcons(Widget w, XtPointer client_data, XtPointer call_data)
  793. {
  794.    char *newname;
  795.    int len;
  796.    int i;
  797.    struct indexlist *tmpname;
  798.  
  799.    len = strlen(duplicate_icons[dup_number]->nameptr->string);
  800.    newname = malloc(len + 5);
  801.    sprintf(newname, "%s 1", duplicate_icons[dup_number]->nameptr->string);
  802.    i = 2;
  803.    while ((tmpname = find_keyword(newname) )!= NULL )
  804.       {
  805.  sprintf(newname, "%s %d", duplicate_icons[dup_number]->nameptr->string, i);
  806.       i++;
  807.       }
  808.    duplicate_icons[dup_number]->nameptr = add_keyword(newname);
  809.    duplicate_icons[dup_number]->nameptr->icon = duplicate_icons[dup_number];
  810.    if (dup_number == dup_icn_cnt-1)
  811.       XtPopdown(DupIcons_w);
  812.    else
  813.       {
  814.       dup_number++;
  815.       setup_dupicons();
  816.       }
  817. }
  818.  
  819. void handle_dup(int number)
  820. {
  821.    struct icntmpltstruct *dup_ptr, *orig_ptr, *prev_ptr;
  822.    struct wordlist *dupkey, *tk;
  823.    struct grpliststruct *dupgrps, *tg;
  824.    struct filelist *dupfiles, *tf, *origfiles;
  825.    struct indexlist *indexptr;
  826.    struct iconstruct *origiconptr, *dupiconptr, *previconptr;
  827.    struct grptmpltstruct *grpptr;
  828.    struct wordlist *klist;
  829.    struct grpliststruct *glist;
  830.    Boolean found_orig;
  831.  
  832.    dup_ptr = duplicate_icons[dup_number];
  833.    orig_ptr = dup_ptr->nameptr->icon;
  834.  
  835.    dupkey = dup_ptr->keywords;
  836.    dupgrps = dup_ptr->grps;
  837.    dupfiles = dup_ptr->addtlfiles;
  838. /* FILES */
  839.    while (dupfiles != NULL)
  840.       {
  841.       while (dupfiles != NULL)
  842.          {
  843.      /* check for each dup file in the orig file list */
  844.          tf = dupfiles->next;
  845.          origfiles = orig_ptr->addtlfiles;
  846.          while (origfiles != NULL && origfiles->file != dupfiles->file)
  847.             origfiles = origfiles->next;
  848.          if (origfiles == NULL) 
  849.             {
  850.     /* if not found, add the dupfile struct to the orig files list */
  851.             dupfiles->next = orig_ptr->addtlfiles;
  852.             orig_ptr->addtlfiles = dupfiles;
  853.             }
  854.          else
  855.             {
  856.     /* if found, toss the dupfiles structure */
  857.             free(dupfiles);
  858.             }
  859.          dupfiles = tf;
  860.          }
  861.       }
  862. /* GROUPS */
  863.    while (dupgrps != NULL)
  864.       {
  865.       previconptr = NULL;
  866.       found_orig = FALSE;
  867.       grpptr = dupgrps->grpptr;
  868.       dupiconptr = grpptr->firstpage->fronticons;
  869.       while (dupiconptr != NULL && dupiconptr->iconptr != dup_ptr)
  870.          {
  871.          if (dupiconptr->iconptr == orig_ptr)
  872.             {
  873.             origiconptr = dupiconptr;
  874.             found_orig = TRUE;
  875.             }
  876.          previconptr = dupiconptr;
  877.          dupiconptr = dupiconptr->nexticon;
  878.          }
  879.       if (!found_orig)  /* didn't file ref to orig demo so far in icon list */
  880.          {
  881.          origiconptr = dupiconptr;
  882.          while (origiconptr != NULL && !found_orig)
  883.             {
  884.             if (origiconptr->iconptr == orig_ptr)
  885.                found_orig = TRUE;
  886.             else
  887.                origiconptr = origiconptr->nexticon;
  888.             }
  889.          }
  890.       if (found_orig)    /* delete the reference to dup demo */
  891.          {
  892.          if (previconptr == NULL)
  893.             grpptr->firstpage->fronticons = dupiconptr->nexticon;
  894.          else
  895.             previconptr->nexticon = dupiconptr->nexticon;
  896.          free(dupiconptr);
  897.          group_setup(NULL, NULL, grpptr);
  898.          }
  899.       else     /* replace ref to dup demo with ref to orig demo */
  900.          {
  901.          dupiconptr->iconptr = orig_ptr;
  902.          orig_ptr->occurences++;
  903.          glist = orig_ptr->grps;
  904.          orig_ptr->grps = (struct grpliststruct *) malloc
  905.                 (sizeof(struct grpliststruct) );
  906.          orig_ptr->grps->grpptr = grpptr;
  907.          orig_ptr->grps->next = glist;
  908.          orig_ptr->grps->prev = glist;
  909.          if (glist != NULL)
  910.             glist->prev = orig_ptr->grps;
  911.          }
  912.       dupgrps = dupgrps->next;
  913.       }
  914.  
  915. /* KEYWORDS */
  916.    while (dupkey != NULL)
  917.       {
  918.       found_orig = FALSE;
  919.       previconptr = NULL;
  920.       indexptr = dupkey->indexptr;
  921.       dupiconptr = indexptr->icons;
  922.       while (dupiconptr->iconptr != dup_ptr && dupiconptr->iconptr != dup_ptr)
  923.          {
  924.          if (dupiconptr->iconptr == orig_ptr)
  925.             {
  926.             origiconptr = dupiconptr;
  927.             found_orig = TRUE;
  928.             }
  929.          previconptr = dupiconptr;
  930.          dupiconptr = dupiconptr->nexticon;
  931.          }
  932.     /* does the original demo also use this keyword? */
  933.       if (!found_orig)  /* didn't file ref to orig demo so far in icon list */
  934.          {
  935.          origiconptr = dupiconptr;
  936.          while (origiconptr != NULL && !found_orig)
  937.             {
  938.             if (origiconptr->iconptr == orig_ptr)
  939.                found_orig = TRUE;
  940.             else
  941.                origiconptr = origiconptr->nexticon;
  942.             }
  943.          }
  944.       if (found_orig)    /* delete the reference to dup demo */
  945.          {
  946.          indexptr->count--;
  947.          if (previconptr == NULL)
  948.             indexptr->icons = dupiconptr->nexticon;
  949.          else 
  950.             previconptr->nexticon = dupiconptr->nexticon;
  951.          free(dupiconptr);
  952.          }
  953.       else     /* replace ref to dup demo with ref to orig demo */
  954.          {
  955.          dupiconptr->iconptr = orig_ptr;
  956.          /* add the new keyword to the orig icons list of keywords */
  957.          klist = orig_ptr->keywords;
  958.          orig_ptr->keywords = (struct wordlist *)
  959.                 malloc (sizeof (struct wordlist) );
  960.          orig_ptr->keywords->next = klist;
  961.          orig_ptr->keywords->indexptr = indexptr;
  962.          }
  963.       dupkey = dupkey->next;
  964.       }
  965. /* clean up storage */
  966.    if (dup_ptr == firsticon)
  967.       firsticon = dup_ptr->nexticntmplt;
  968.    else
  969.       {
  970.       prev_ptr = firsticon;
  971.       while (prev_ptr != NULL && prev_ptr->nexticntmplt != dup_ptr)
  972.          {
  973.          prev_ptr = prev_ptr->nexticntmplt;
  974.          }
  975.       if (prev_ptr != NULL)
  976.          {
  977.          prev_ptr->nexticntmplt = dup_ptr->nexticntmplt;
  978.          if (dup_ptr == lasticon)
  979.             lasticon = prev_ptr;
  980.          }
  981.       }
  982.    free(dup_ptr->poly);
  983.    dupkey = dup_ptr->keywords;
  984.    while (dupkey != NULL)
  985.       {
  986.       tk = dupkey->next;
  987.       free(dupkey);
  988.       dupkey = tk;
  989.       }
  990.    dup_ptr->nameptr->count--;
  991.    free(dup_ptr->startstring);
  992.    dupgrps = dup_ptr->grps;
  993.    while (dupgrps != NULL)
  994.       {
  995.       tg = dupgrps->next;
  996.       free(dupgrps);
  997.       dupgrps = tg;
  998.       }
  999.    dupfiles = dup_ptr->addtlfiles;
  1000.    free(dup_ptr);
  1001. }
  1002.  
  1003.  
  1004. void yesCB_DupIcons(Widget w, XtPointer client_data, XtPointer call_data)
  1005. {
  1006.    handle_dup(dup_number);
  1007.    if (dup_number == dup_icn_cnt-1)
  1008.       XtPopdown(DupIcons_w);
  1009.    else
  1010.       {
  1011.       dup_number++;
  1012.       setup_dupicons();
  1013.       }
  1014. }
  1015.  
  1016. void resolveCB_AskDupIcons(Widget w, XtPointer client_data, XtPointer call_data)
  1017. {
  1018.    XtPopdown(AskDupIcons_w);
  1019.  
  1020.    popup_DupIcons();
  1021. }
  1022.  
  1023. void ignoreCB_AskDupIcons(Widget w, XtPointer client_data, XtPointer call_data)
  1024. {
  1025.    XtPopdown(AskDupIcons_w);
  1026. }
  1027.  
  1028.